x86/shadow: Fix build with no PG_log_dirty
authorAndrew Cooper <andrew.cooper3@citrix.com>
Fri, 31 Mar 2023 06:32:11 +0000 (08:32 +0200)
committerJan Beulich <jbeulich@suse.com>
Fri, 31 Mar 2023 06:32:11 +0000 (08:32 +0200)
commit11c8ef59b9024849c0fc224354904615d5579628
tree241cacfdd5cfba84f56f6e4af8eb2992db7939ec
parent00aa5c93d14c6561a69fe204cbe29f7519830782
x86/shadow: Fix build with no PG_log_dirty

Gitlab Randconfig found:

  arch/x86/mm/shadow/common.c: In function 'shadow_prealloc':
  arch/x86/mm/shadow/common.c:1023:18: error: implicit declaration of function
      'paging_logdirty_levels'; did you mean 'paging_log_dirty_init'? [-Werror=implicit-function-declaration]
   1023 |         count += paging_logdirty_levels();
        |                  ^~~~~~~~~~~~~~~~~~~~~~
        |                  paging_log_dirty_init
  arch/x86/mm/shadow/common.c:1023:18: error: nested extern declaration of 'paging_logdirty_levels' [-Werror=nested-externs]

The '#if PG_log_dirty' expression is currently SHADOW_PAGING && !HVM &&
PV_SHIM_EXCLUSIVE.  Move the declaration outside.

Fixes: 33fb3a661223 ("x86/shadow: account for log-dirty mode when pre-allocating")
Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
master commit: 6d14cb105b1c54ad7b4228d858ae85aa8a672bbd
master date: 2023-03-24 12:16:31 +0000
xen/arch/x86/include/asm/paging.h